﻿<%@ Page Language="C#" MasterPageFile="~/Admin/AdminMasterPage.master" AutoEventWireup="true"
    CodeFile="UpdateScrollingProviderLogo.aspx.cs" Inherits="Admin_provider_UpdateScrollingProviderLogo"
    Title="Company Logo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div class="contents">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>            
            <table width="100%" cellpadding="3" cellspacing="0" border="0">
                <tr>
                    <td colspan="2">
                        <h1>Update Scrolling Company Logo</h1>
                    </td>
                </tr>
                <tr>
                    <td style="width: 30%"; valign="top">
                        Provider Company Name
                    </td>
                    <td valign="top">
                        <asp:DropDownList ID="ddlProviderCompanyName" runat="server" AutoPostBack="True"
                            OnSelectedIndexChanged="ddlProviderCompanyName_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="rfvProviderCompanyName" runat="server" ErrorMessage="Choose Provider Company"
                            ControlToValidate="ddlProviderCompanyName" ValidationGroup="uploadlogo" InitialValue="-1"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td valign="top">
                        <asp:Image ID="imgCompanyLogo" ImageUrl="~/captcha/new_company_logo.GIF" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        Serverl Url:
                    </td>
                    <td valign="top">
                        <asp:Label ID="lblServerUrl" runat="server" Text="None"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        Upload New Company Logo
                    </td>
                    <td>
                        <div id="divFileName" style="display: none">
                            <asp:TextBox ID="txtLogoFilePath" runat="server"></asp:TextBox>
                        </div>
                        <input id="fleUpload" style="width: 350;" runat="server" type="file" />
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    <table width="100%" cellpadding="3" cellspacing="0" border="0">
        <tr>
            <td style="width: 30%"; valign="top">
                &nbsp;
            </td>
            <td>
                <div>
                    <asp:Button ID="btnSubmit" ValidationGroup="uploadlogo" runat="server" OnClick="btnSubmit_Click"
                        Text="Submit" CssClass="btn blue" />
                </div>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                <asp:Label runat="server" ID="lblMessage" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Cellspacing="3" CellPadding="3" Width="100%"
                    DataKeyNames="ProviderCompanyId" RowStyle-Height="50px" DataSourceID="sqlDsScrollingCompanyLogo"
                    CssClass="admin_gridstyle" PagerStyle-CssClass="pgr" GridLines="None">
                    <Columns>
                        <asp:BoundField DataField="ProviderCompanyId" HeaderText="ID" InsertVisible="False"
                            ReadOnly="True" SortExpression="ProviderCompanyId" />
                        <asp:BoundField DataField="CompanyName" HeaderText="Company Name" SortExpression="CompanyName" />
                        <asp:BoundField DataField="CompanyScrollingLogoUrl" HeaderText="Logo Path" SortExpression="CompanyScrollingLogoUrl" />
                        <asp:ImageField DataAlternateTextField="CompanyName" DataImageUrlField="CompanyScrollingLogoUrl">
                        </asp:ImageField>
                    </Columns>
                    <FooterStyle />
                    <PagerStyle />
                    <SelectedRowStyle />
                    <HeaderStyle CssClass="admin_gridheader" />
                    <EditRowStyle />
                    <AlternatingRowStyle CssClass="admin_gridodd" />
                    <RowStyle CssClass="admin_grideven" />
                </asp:GridView>
                <asp:SqlDataSource ID="sqlDsScrollingCompanyLogo" runat="server" ConnectionString="<%$ ConnectionStrings:TH.CX_DBConnectionString %>"
                    SelectCommand="SELECT [ProviderCompanyId], [CompanyName], [CompanyLogoSmall2], [CompanyScrollingLogoUrl] FROM [tblProviderCompany]">
                </asp:SqlDataSource>
            </td>
        </tr>
    </table>
</div>

    <script type="text/javascript">
    function SetFileName()
    {
        //var prefix = getCrtlPrefix();
        var CtrlFileUp = document.getElementById('fleUpload');
        //alert(CtrlFileUp.value);
        //var lblPath = document.getElementById(prefix + 'lblFilePath');
        var txtPath = document.getElementById('<%=txtLogoFilePath.ClientID%>');
        alert(CtrlFileUp.innerHTML);
        //alert(lblPath.value);
        txtPath.value = CtrlFileUp.value;
        //lblPath.innerHTML = CtrlFileUp.value;
    }
    </script>

</asp:Content>
